//
//  DLTabbarVC.m
//  AllPass
//
//  Created by apple on 2021/11/1.
//

#import "DLTabbarVC.h"
#import "DLDatabaseListVC.h"
#import "DLUserSettingVC.h"
#import "BXNavigationController.h"
@interface DLTabbarVC ()

@end

@implementation DLTabbarVC

- (void)viewDidLoad {
    [super viewDidLoad];
    DLDatabaseListVC * vc = [[DLDatabaseListVC alloc]init];
    vc.tabBarItem = [[UITabBarItem alloc]initWithTitle:NSLocalizedString(@"Main", nil) image:Image(@"球场") selectedImage:[self backImage:Image(@"球场-绿色")]];
    BXNavigationController * navVC = [[BXNavigationController alloc]initWithRootViewController:vc];

        //个人
    DLUserSettingVC * person  = [DLUserSettingVC new];
    person.tabBarItem = [[UITabBarItem alloc]initWithTitle:NSLocalizedString(@"Setting", nil) image:Image(@"社区") selectedImage:[self backImage:Image(@"社区-绿色")]];
    BXNavigationController * personNav = [[BXNavigationController alloc]initWithRootViewController:person];
    
    [[UITabBarItem appearance]setTitleTextAttributes:@{NSForegroundColorAttributeName:TabbarTextColor} forState:UIControlStateSelected];
    self.viewControllers = @[navVC,personNav];
    self.selectedIndex = 0;
}

-(UIImage*)backImage:(UIImage*)image{
    return  [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}
@end
